package com.lry.basic.nio.mapped;

import java.io.*;

public class TestMapperFile {

    public static void main(String[] args) throws IOException {

        MappedFile mappedFile = new MappedFile(new FrameIndexFile(),1024*1024*20);

        //写入
        for(int i=1;i<=40000;i++){
            String msg = "Hello World"+i;
            mappedFile.put(new Frame(i,msg));
        }


        //读取
        System.out.println("--------------------------findById--------------------------------");
        for(int i=1;i<=40000;i++){
            System.out.println(mappedFile.findById(i));
        }
    }



}
